package com.sxt.sys.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.sxt.sys.SYSConstast.SYSConstast;
import com.sxt.sys.service.LoginInforService;
import com.sxt.sys.utils.DataGridView;
import com.sxt.sys.utils.ResultObj;
import com.sxt.sys.vo.LoginInforVo;

@RestController
@RequestMapping("loginInfor")
public class LoginInforController {
	
	
	@Autowired
	private LoginInforService inforService;
	
	
	@RequestMapping("loadAllLoginInfor")
	public DataGridView loadAllLoginInfor(LoginInforVo inforVo) {
		return inforService.queryAllLoginInfor(inforVo);
	}
	
	@RequestMapping("deleteLoginInfor")
	public ResultObj deleteLoginInfor(LoginInforVo inforVo) {
		Integer code=1;
		String msg="";
		try {
			Integer info = inforService.deleteLoginInfor(inforVo.getId());
			code = info;
			msg = info > 0 ?SYSConstast.DELETE_LOGININFOR_TRUE:SYSConstast.DELETE_LOGININFOR_FALSE;
		} catch (Exception e) {
			code = 0;
			msg = SYSConstast.DELETE_LOGININFOR_FALSE;
		}
		return new ResultObj(code , msg);
	}
	
	
}
